package com.luomu.base.control.config;

import org.springframework.cloud.client.loadbalancer.reactive.ReactorLoadBalancerExchangeFilterFunction;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpHeaders;
import org.springframework.web.reactive.function.client.WebClient;

@Configuration
public class WebClientConfiguration {

    @Bean
    public WebClient webClient(ReactorLoadBalancerExchangeFilterFunction function){
        return WebClient.builder().filter(function)
                .defaultHeader(HttpHeaders.CONTENT_TYPE, "application/json")
                .baseUrl("http://base-biz/userChatService").build();
    }
}
